APP_DIR := src
OBJ_DIR := obj

SRC := $(wildcard ${APP_DIR}/*.c)
OBJ := $(patsubst %.c,${OBJ_DIR}/%.o,$(notdir ${SRC}))

CC = gcc
CFLAGS := -Wall -g -Iinc

all:client server
	@echo make end

client:obj/client.o
	$(CC) -o $@ $<

server:obj/server.o
	$(CC) -o $@ $<

obj/client.o:src/client.c
	$(CC) -o $@ -c $< $(CFLAGS)

obj/server.o:src/server.c
	$(CC) -o $@ -c $< $(CFLAGS)

.PHONY:clean
clean:
	find ${DIR_OBJ} -name *.o | xargs rm -rf 
	rm -rf server client
	@echo "clean end"